package com.jake.demo.controller;

import com.jake.demo.vo.Product;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("products")
public class ProductController {

    @GetMapping("")
    public List<Product> findAllProducts() {
        List<Product> products = new ArrayList<>();
        products.add(new Product(1, "iPhone"));
        products.add(new Product(2, "iPad"));
        products.add(new Product(3, "iMac"));
        return products;
    }
}
